import { constantRoutes, asyncRoutes } from '@/router/index'
export default {
  namespaced: true,
  state: {
    routes: constantRoutes
  },
  mutations: {
    setRoutes(state, otherRoutes) {
      state.routes = [...constantRoutes, ...otherRoutes]
    }
  },
  actions: {
    filterRoutes(context, menus) {
      console.log(context, menus)
      const res = asyncRoutes.filter(item => menus.includes(item.children[0].name))
      return res
    }
  },
  getters: {}
}
